const fs = require("fs");
const loader = require("@assemblyscript/loader");


const imports = {
    main: {
        print: jsprint
    }
};

const wasmModule = loader.instantiateSync(fs.readFileSync(__dirname + "/build/optimized.wasm"), imports);

function jsprint(strPrt) {
    const str = wasmModule.exports.__getString(strPrt);
    console.log(str);
}

wasmModule.exports.helloWorld()



const namePrt = wasmModule.exports.__newString('hans'),
    str = wasmModule.exports.__getString(wasmModule.exports.hello(namePrt));
console.log(str);



// module.exports = wasmModule.exports;